
from app import api


class add_api_resource:
    """装饰器方法，指定API的资源地址
    """

    def __init__(self, *args, **kw):
        """初始化装饰器参数
        """
        self.args = args
        self.kwards = kw

    def __call__(self, resource):
        """添加资源到路径中
        """
        api.add_resource(resource, *self.args, **self.kwards)
        return resource



